package com.createidea.scrumfriend.struts.action;

import java.awt.Font;
import java.text.DecimalFormat;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.labels.CategoryItemLabelGenerator;
import org.jfree.chart.labels.StandardCategoryItemLabelGenerator;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.CategoryItemRenderer;
import org.jfree.chart.title.TextTitle;

import com.createidea.scrumfriend.service.statistics.StatisticsService;

public class StatisticsAction extends BaseAction {
    
	//private JFreeChart chart;
	private StatisticsService statisticsService;
	private String projectId;
	private String sprintId;
	private float[][] dataForBurnDown;
	 
	public String testchart(){
		
//         chart= ChartFactory.createLineChart("Pie Chart",  "Sprint Serial","Story Point", statisticsService.createDataset(),PlotOrientation.VERTICAL, true, // legend     
//         false, false);

 
		return SUCCESS;
	}
    
	public String prepareProjectBurnDownChart(){
		 //dataForBurnDown=statisticsService.createDataForProjectBurnDown(projectId);
		float score[][]={{45,12,8,23,89,56},{48,17,8,29,89,86}};
		dataForBurnDown=score;
		 return SUCCESS;
	}
	
	public String prepareSprintsChart(){
		//dataForBurnDown=statisticsService.createDataForProjectBurnDown(projectId);
		float score[][]={{45,12,8,23,89,56}};
		dataForBurnDown=score;
		return SUCCESS;

	}
	
	public String prepareSprintBurnDownChart(){
		 
		 return SUCCESS;
	}
	public String gototestchart(){
		return SUCCESS;
	}
	
	

	public StatisticsService getStatisticsService() {
		return statisticsService;
	}

	public void setStatisticsService(StatisticsService statisticsService) {
		this.statisticsService = statisticsService;
	}

	public String getProjectId() {
		return projectId;
	}

	public void setProjectId(String projectId) {
		this.projectId = projectId;
	}

	public String getSprintId() {
		return sprintId;
	}

	public void setSprintId(String sprintId) {
		this.sprintId = sprintId;
	}

	public float[][] getDataForBurnDown() {
		return dataForBurnDown;
	}

	public void setDataForBurnDown(float[][] dataForBurnDown) {
		this.dataForBurnDown = dataForBurnDown;
	}
	
	
	
}
